/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 TCPFactory.hpp. Created on: 20.08.2009 15:14:18
 */

#ifndef TCPFACTORY_HPP_
#define TCPFACTORY_HPP_

#include "TCPSharedResources.hpp"
#include "smartobjects/SmartObjectsDefs.hpp"
#include "smartobjects/network/INetworkFactory.hpp"


namespace smartobjects {

class TCPFactory : public INetworkFactory {
public:
	SO_DLLPRFX TCPFactory();
	SO_DLLPRFX virtual ~TCPFactory();

	SO_DLLPRFX virtual IAcceptor* createAcceptor() ;
	SO_DLLPRFX virtual IAcceptor* createAcceptor(URI*) throw (const IOException&) ;

	SO_DLLPRFX virtual IConnector* createConnector() ;
	SO_DLLPRFX virtual IConnector* createConnector(URI*) throw (const IOException&) ;

	SO_DLLPRFX virtual void setPacketFormerFactory(IPacketFormerFactory*) ;
	SO_DLLPRFX virtual IPacketFormerFactory* getPacketFormerFactory() ;

	SO_DLLPRFX virtual void setHandshakeManagerFactory(IHandshakeManagerFactory*) ;
	SO_DLLPRFX virtual IHandshakeManagerFactory* getHandshakeManagerFactory() ;
protected:

	TCPSharedResources::SharedPtr m_poSharedResources;
};

}

#endif /* TCPFACTORY_HPP_ */
